//对API进行统一管理
import requests from "./requests";

//三级联动接口
// /api/product/getBaseCatego/api/product/getBaseCategoryLisryLis

// 请求三级联动列表信息
export let reqCategoryList = ()=> requests({url:'/api/product/getBaseCategoryList'});
// 请求Home主页 轮播图信息
export let reqBannerList = ()=> requests({url:'/mock/banner'});

// 请求home主页floor面板信息
export let reqFloorList = ()=> requests({url:'/mock/floor'});

// 请求搜索页商品信息
export let reqSearchList = (params)=> requests({url:'/api/list',method:'post',data:params});

// 请求商品详情信息
export let reqGoodsList = (skuId)=> requests({url:`/api/item/${skuId}`,method:'get'});

//将商品添加到购物车中（获取更新某一个产品的个数）
export let reqAddOrUpdateShopCart = (skuId,skuNum)=> requests({url:`/api/cart/addToCart/${skuId}/${skuNum}`,method:'post'});

//请求购物车列表
export let reqShopCart = ()=> requests({url:'/api/cart/cartList',method:'get'});

//删除购物车商品
export let deleteShopCart = (skuId)=> requests({url:`/api/cart/deleteCart/${skuId}`,method:'delete'});

//获取验证码
export let reqGetCode = (phone)=> requests({url:`/api/user/passport/sendCode/${phone}`,method:'get'});

//用户注册
export let reqUserRegister = (data)=> requests({url:`/api/user/passport/register`,method:'post',data});

//用户登录
export let reqLogin = (data)=> requests({url:`/api/user/passport/login`,method:'post',data});

// 获取用户信息
export let getUserInfo = (data)=> requests({url:`/api/user/passport/auth/getUserInfo`,method:'get'});





